package org.hs.phd.common.simpleplayer.overlay;

import java.awt.BasicStroke;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Polygon;
import java.awt.Stroke;

import org.hs.phd.common.simpleplayer.Overlay;

public class PolygonalOverlay implements Overlay {

	private final Polygon shape;
	private final Paint paint;
	private final Stroke stroke;
	
	public PolygonalOverlay(Polygon shape, Paint paint) {
		this(shape, paint, new BasicStroke(1));
	}
	
	public PolygonalOverlay(Polygon shape, Paint paint, Stroke stroke) {
		this.shape = shape;
		this.paint = paint;
		this.stroke = stroke;
	}

	@Override
	public void paint(Graphics g) {
		Graphics2D g2 = (Graphics2D) g;
		g2.setPaint(paint);
		g2.setStroke(stroke);
		g2.drawPolygon(shape);
	}
	
	
	
}
